Skip to content

Fix Windows CI and update Python version support#131

Merged
Takishima merged 10 commits intomainfrom
claude/fix-ci-system-tests-7DOzW
Jan 7, 2026
Merged

Fix Windows CI and update Python version support#131
Takishima merged 10 commits intomainfrom
claude/fix-ci-system-tests-7DOzW

Conversation

@Takishima
Copy link
Copy Markdown
Owner

@Takishima Takishima commented Jan 7, 2026

Summary

  • Fix Windows system tests that have been failing in CI
  • Drop support for EOL Python versions and add Python 3.13

Changes

1. Fix PowerShell exit code handling (tests/run_tests.ps1)

  • Replace $? with $LASTEXITCODE for proper exit code capture
  • Fix inverted test logic: cmake_good should fail when exit code != 0, cmake_bad should fail when exit code == 0
  • Add exit code to error message for easier debugging

$? in PowerShell is a boolean (True/False), not the actual exit code. The correct way to capture external program exit codes is $LASTEXITCODE.

2. Fix broken cppcheck installation (.github/workflows/ci.yml)

The Chocolatey cppcheck package was compiled with a hardcoded FILESDIR path that doesn't exist on GitHub Actions runners. Additionally, Strawberry Perl (pre-installed on Windows runners) bundles a broken cppcheck that was being picked up.

Fix: Use the cppcheck pip wheel package which works correctly.

3. Update Python version support

  • Drop Python 3.8 and 3.9 (end-of-life)
  • Add Python 3.13 support
  • Minimum Python version is now 3.10
  • Update ruff target-version to py310

Test plan

  • Windows system tests pass in CI
  • Linux system tests continue to pass
  • macOS system tests continue to pass
  • Unit tests pass for Python 3.10, 3.11, 3.12, 3.13

claude added 2 commits January 7, 2026 06:08
- Replace $? with $LASTEXITCODE for proper exit code capture
- Fix inverted test logic: cmake_good should fail when exit code != 0,
  cmake_bad should fail when exit code == 0
- Add exit code to error message for easier debugging

$? in PowerShell is a boolean (True/False), not the actual exit code.
The correct way to capture external program exit codes is $LASTEXITCODE.
The Chocolatey cppcheck package is broken - it was compiled with a
hardcoded FILESDIR path that doesn't exist on GitHub Actions runners:

  "Failed to load std.cfg. The Cppcheck binary was compiled with
   FILESDIR set to R:/winlibs64ucrt_stage/inst_cppcheck-2.14.0/share/Cppcheck"

The official cppcheck project marks the Chocolatey package as outdated
and recommends using Scoop instead. This change:
- Installs cppcheck via Scoop instead of Chocolatey
- Adds Scoop shims directory to PATH for the job
@Takishima Takishima changed the title Fix PowerShell system test exit code handling Fix Windows CI system tests Jan 7, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2ad3c44) to head (61d7596).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #131   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          604       604           
  Branches       114       101   -13     
=========================================
  Hits           604       604           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Jan 7, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 2ad3c441 (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (2ad3c44) Report Missing Report Missing Report Missing
Head commit (61d7596) 604 604 100.00%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#131) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

- Drop support for Python 3.8 and 3.9 (end-of-life)
- Add support for Python 3.13
- Minimum required Python version is now 3.10
- Update ruff target-version to py310
- Fix Windows CI: use pip cppcheck wheel instead of broken Chocolatey package
  (Strawberry Perl's bundled cppcheck was being picked up instead of scoop's)
@Takishima Takishima changed the title Fix Windows CI system tests Fix Windows CI and update Python version support Jan 7, 2026
claude and others added 6 commits January 7, 2026 07:20
The PROFILE was running Enter-VsDevShell in every PowerShell step,
resetting PATH each time and overriding the Python set by setup-python.

Now VsDevShell setup only runs in the Prepare env step itself.
…hell

The ilammy/msvc-dev-cmd action already sets up MSVC environment and
exports it to GITHUB_ENV before setup-python runs. The manual
Enter-VsDevShell call was redundant and caused PATH conflicts.
The Update-SessionEnvironment call from chocolatey was overwriting
MSVC environment variables set by ilammy/msvc-dev-cmd. By moving
the MSVC dev command step after chocolatey packages are installed,
we ensure the MSVC environment persists to subsequent steps.

Co-authored-by: Claude <noreply@anthropic.com>
* Fix Windows CI: restore Python PATH after MSVC setup

The ilammy/msvc-dev-cmd action runs vcvarsall.bat which prepends
Visual Studio paths to PATH. VS 2022 includes a bundled Python 3.9,
which then takes precedence over the Python 3.10+ set up by
actions/setup-python.

This caused pre-commit to use Python 3.9 when installing the
cmake-pre-commit-hooks package, which fails because the package
requires Python 3.10+.

Fix by adding a step after msvc-dev-cmd that writes the correct
Python path to GITHUB_PATH, ensuring it's prepended in subsequent
steps.

* Add debugging for Windows Python PATH verification

Add a step to verify which Python and pre-commit are being used
after the PATH restoration to help diagnose CI failures.

* Fix Windows CI: ensure python3 points to correct Python

Pre-commit looks for 'python3' when creating virtualenvs for hooks.
After MSVC dev cmd runs, 'python3' might point to VS's bundled Python 3.9
instead of the Python 3.10+ from actions/setup-python.

This fix:
1. Creates python3.exe as a copy of python.exe if it doesn't exist
2. Uses a fresh PRE_COMMIT_HOME to avoid cached environments
3. Adds detailed PATH debugging to diagnose issues

* Fix Windows CI: restore Python PATH after Update-SessionEnvironment

The chocolatey Update-SessionEnvironment command resets PATH from
system environment variables, which overwrites the Python path set
by actions/setup-python. This caused pip to install packages into
Python 3.9.13 (system Python) instead of Python 3.12.10.

Fix by explicitly restoring pythonLocation to PATH immediately after
Update-SessionEnvironment, before running pip install.

* Remove debugging code from Windows CI

---------

Co-authored-by: Claude <noreply@anthropic.com>
@Takishima Takishima merged commit cb73f87 into main Jan 7, 2026
38 checks passed
@Takishima Takishima deleted the claude/fix-ci-system-tests-7DOzW branch January 7, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants